package com.yic.module.qms.controller.admin.inspectprocess.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

import static com.yic.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 过程检验 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class InspectProcessBaseVO {

    @Schema(description = "检验单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "检验单号不能为空")
    private String code;

    @Schema(description = "工厂", requiredMode = Schema.RequiredMode.REQUIRED, example = "25312")
    @NotNull(message = "工厂不能为空")
    private Long factoryId;

    @Schema(description = "检验方案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16388")
    @NotNull(message = "检验方案ID不能为空")
    private Long schemeId;

    @Schema(description = "生产计划", requiredMode = Schema.RequiredMode.REQUIRED, example = "28129")
    @NotNull(message = "生产计划不能为空")
    private Long planId;

    @Schema(description = "生产工单", requiredMode = Schema.RequiredMode.REQUIRED, example = "15327")
    @NotNull(message = "生产工单不能为空")
    private Long moId;

    @Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704")
    @NotNull(message = "产品ID不能为空")
    private Long itemId;

    @Schema(description = "产品生产ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8292")
    @NotNull(message = "产品生产ID不能为空")
    private Long itemProduceId;

    @Schema(description = "工序ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "58")
    @NotNull(message = "工序ID不能为空")
    private Long processId;

    @Schema(description = "检测数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "检测数量不能为空")
    private BigDecimal inspectAmount;

    @Schema(description = "合格数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "合格数量不能为空")
    private BigDecimal qualifiedAmount;

    @Schema(description = "不合格数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "不合格数量不能为空")
    private BigDecimal unqualifiedAmount;

    @Schema(description = "检测结果", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "检测结果不能为空")
    private Integer inspectResult;

    @Schema(description = "检测人", requiredMode = Schema.RequiredMode.REQUIRED, example = "8619")
    private Long userId;

    @Schema(description = "检测时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "检测时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime inspectTime;

    @Schema(description = "备注", example = "随便")
    private String remark;

}
